import { Controller, Get, HttpCode, Res } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  /**
   * localhost:3000/
   */
  @Get()
  hello() {
    return this.appService.getHello();
  }

  /**
   * localhost:3000/
   */
  @Get('201')
  @HttpCode(201)
  returnHttpCode201() {
    return this.appService.getHello();
  }

  /**
   * localhost:3000/status
   */
  @Get('status')
  getHello(@Res() response) {
    console.log(response);
    response.status(200).send('123');
  }
}
